package com.jimmy.medical.enums;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Desc: 图片用途
 *
 * @author jimmy

 * @date 2018-04-19
 */
public enum PictureUseTypeEnum {

	NORMAL(1, "普通用途"),
	EVALUATION(4, "评估报告的专用附件"),
	ADVANCE_FEE(5, "垫付费用凭据"),
	REIMBURSE_FEE(6, "报销凭证"),
	CHECK_APPEARANCE(7, "自检仪容"),
	DIAGNOSE(8, "陪诊图片"),
	SIGN_CHECK(9, "备单核验"),
	PHYSICAL_CHECK(10, "陪检图片"),
	TAKE_REPORT(11, "取报告"),
	CHECK(12, "开检查单"),
	CHECK_REPORT(13, "开检查单");

	private int key;	//代码
	private String text;	//名称

	PictureUseTypeEnum(int key, String text) {
		this.key = key;
		this.text = text;
	}

	/**
	 * 根据key获取名称
	 */
	public static String getTextByKey(int key) {
		for (PictureUseTypeEnum obj : PictureUseTypeEnum.values()) {
			if (obj.key == key) {
				return obj.text;
			}
		}
		return null;
	}
	
	/**
	 * 将枚举类型转换为Map
	 * @return
	 */
	public static Map<Integer, String> getMapValue() {
		Map<Integer, String> map = new LinkedHashMap<Integer, String>();
		for (PictureUseTypeEnum obj : PictureUseTypeEnum.values()) {
			map.put(obj.key, obj.text);
		}
		return map;
	}
	
	public int getKey() {
		return key;
	}

	public String getText() {
		return text;
	}
	
}
